package com.yuanfeng.userms.controller;


import com.yuanfeng.commoms.util.ResponseResult;
import com.yuanfeng.commoms.vo.fx.VKUserInfoVO;
import com.yuanfeng.commoms.vo.fx.VkApplyOrderVO;
import com.yuanfeng.commoms.vo.goods.FXGoodsListVO;
import com.yuanfeng.userms.dto.UserApplyConfirmDTO;
import com.yuanfeng.userms.vo.MallVkQueryVO;
import com.yuanfeng.userms.vo.YgRankVO;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * @ClassName UserVkController
 * @Description 店铺微客会员表
 * @Author cyp
 * @Date 2023-06-05 11:00:51
 * @Version 1.0
 **/
@RestController
@RequestMapping("userVk")
public class UserVkController extends BaseController {
    /**
     * 查询微客用户信息
     * @param paraMap
     * @return
     */
    @PostMapping("/queryVKUserInfo")
    public ResponseResult queryVKUserInfo(@RequestBody Map<String, String> paraMap) {
        VKUserInfoVO vkUserInfo = userVkService.queryVKUserInfo(paraMap);
        return ResponseResult.success(vkUserInfo);
    }
    /**
     * 商品分享记录
     * @param data
     * @return
     */
    @PostMapping("/shareGoodsRecord")
    public ResponseResult shareGoodsRecord(@RequestBody String data) {
        ResponseResult result =userVkService.shareGoodsRecord(data);
        return result;
    }
    /**
     *  第一次购买用户成为店铺会员
     * @param data
     * @return
     */
    @PostMapping("/addShopVipUser")
    public ResponseResult addShopVipUser(@RequestBody String data){
        ResponseResult result =userVkService.addShopVipUser(data);
        return result;
    }

    /**
     * 微客申请购买商品
     * @param data
     * @return
     */
    @PostMapping("/vkApply")
    public ResponseResult vkApply(@RequestBody Map<String,List<VkApplyOrderVO>> data) {
        ResponseResult result = userVkService.vkApply(data);
        return result;
    }


    /**
     * 微客申请页  信息和校验
     * @param vkApplyConfirm
     * @return
     */
    @PostMapping("/vkApplyPage")
    public ResponseResult vkApplyPage(@RequestBody Map<String, String> vkApplyConfirm){
        ResponseResult result= userVkService.vkApplyPage(vkApplyConfirm);
        return  result;
    }


    /**
     * 微客提交申请
     * @param vkApplyConfirm
     * @return
     */
    @PostMapping("/vkApplyConfirm")
    public ResponseResult vkApplyConfirm(@RequestBody Map<String, String> vkApplyConfirm){
        ResponseResult result= userVkService.vkApplyConfirm(vkApplyConfirm);
        return  result;
    }
    /**
     * 商家中心手动添加微客
     * @param map
     * @return
     */
    @PostMapping("/addVkInfo")
    public ResponseResult addVkInfo(@RequestBody Map<String,Object> map) {
        ResponseResult result= userVkService.addVkInfo(map);
        return  result;
    }
    /**
     * 商家中心--查询微客业绩
     * @param mallVkQuery
     * @return
     */
    @RequestMapping("/queryShopVk")
    public ResponseResult queryShopVk(@RequestBody MallVkQueryVO mallVkQuery){
        return  userVkService.queryShopVk(mallVkQuery);
    }

    /**
     * 员工申请页  信息和校验
     * @param vkApplyConfirm
     * @return
     */
    @PostMapping("/ygApplyPage")
    public ResponseResult ygApplyPage(@RequestBody UserApplyConfirmDTO vkApplyConfirm) {
        return userVkService.ygApplyPage(vkApplyConfirm);
    }

    /**
     * 我的邀请人
     *
     * @param paraMap
     * @return
     * @throws IOException
     */
    @PostMapping("/getAskUserInfo")
    public ResponseResult getAskUserInfo(@RequestBody Map<String, String> paraMap){
        return userVkService.getAskUserInfo(paraMap);
    }

    /**
     *员工排行榜
     * @param ygRank
     * @return
     */
    @PostMapping("/queryYgRank")
    public ResponseResult queryYgRank(@RequestBody YgRankVO ygRank){
        return  userVkService.queryYgRank(ygRank);
    }

    /**
     * 今日分享商品
     * @param fxGoodsListRequest
     * @return
     */
    @RequestMapping("/queryTodayShareGoods")
    public ResponseResult queryTodayShareGoods(@RequestBody FXGoodsListVO fxGoodsListRequest){
        return userVkService.queryTodayShareGoods(fxGoodsListRequest);
    }
}
